import React, { Component } from "react";

class DangerouslySetInnerHTML extends Component {
  constructor() {
    super();
    this.state = {
      content: "<h1>我是一个标题</h1>"
    };
  }
  render() {
    return (
      <div
        style={{ color: "red" }}
        dangerouslySetInnerHTML={{ __html: this.state.content }}
      />
    );
  }
}

export default DangerouslySetInnerHTML;
